package com.ljx.itbbs.server.article.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.security.core.parameters.P;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-03-27  15:51
 */
@Getter
@AllArgsConstructor
public enum GradeEnum {

    V1(0L, 1),
    V2(1000L, 2),
    V3(10000L, 3),
    V4(100000L, 4),
    V5(1000000L, 5);

    private Long exp;

    private Integer grade;

    public static GradeEnum getGradeByExp(Long exp){
        if (exp < 1000L){
            return GradeEnum.V1;
        } else if (exp < 10000L){
            return GradeEnum.V2;
        } else if (exp < 100000L){
            return GradeEnum.V3;
        } else if (exp < 1000000L){
            return GradeEnum.V4;
        } else {
            return GradeEnum.V5;
        }
    }



}
